<?php

namespace app\logic\main;

use linkphp\Application;

class Forum
{

    public function getForumList()
    {
        return Application::get('forumData')->getForumList();
    }

    public function push($user)
    {
        if($user = Application::get('auth')->getUserInfo()){
            return Application::get('forumData')->push($user);
        } else {
            return ['code' => 2, 'msg' => '未登入'];
        }
    }

    public function getItem()
    {
        return Application::get('forumData')->getItem();
    }

    public function reply()
    {
        if($user = Application::get('auth')->getUserInfo()){
            return Application::get('forumData')->reply($user);
        } else {
            return ['code' => 2, 'msg' => '未登入'];
        }
    }

}